import socket from "./index";
interface ILoginInfo {
    uEmail: string;
    uPwd: string;
}
export interface ISignInData {
    uUid: string,
    uNickName: string,
    uEmail: string,
}
interface IAnswer {
    code: number;
    msg: string;
    data: ISignInData
}
const signIn = (loginInfo: ILoginInfo) => {
    return new Promise((resolve,reject) => {
        socket.emit('signIn',loginInfo)
        socket.on('signIn',(answer: IAnswer) => {
            if(answer.code === 200){
                resolve(answer.data)
            }else{
                reject(answer.msg)
            }
        })
    })
}

export default signIn
